package com.tumblr.anond2.solr.client.solrj;

import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.impl.LBHttpSolrServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SolrConnection {

	final static Logger logger = LoggerFactory.getLogger(SolrConnection.class);
	
	private static SolrServer server = null;
	private String[] connectionString = null;
	
	public SolrConnection(String... connectionString)  {
		this.connectionString = connectionString;
	}
	
	public void open() throws Exception{
		server = new LBHttpSolrServer(connectionString);
	}
	
	public static SolrServer getSolrServer() throws Exception{
		return server;
	}
	
	public void close(){
		server.shutdown();
	}

}
